package com.wry.controller;

import com.wry.dto.AccountDeductedDTO;
import com.wry.service.AccountApiService;
import com.wry.util.ApiResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <h1>  <h1>
 *
 * @author 魏如元
 * @since 2022/10/10
 */
@RestController
@RequestMapping("account")
@Slf4j
public class AccountController {

    @Resource
    private AccountApiService accountApiService;

    @PostMapping("deducted")
    public ApiResult<String> accountDeducted(@RequestBody AccountDeductedDTO deductedDTO){
        accountApiService.accountDeducted(deductedDTO);
        return ApiResult.SUCCESS("账户扣减成功！");
    }
}
